<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page language="java" contentType="text/html; charset=utf-8"
         pageEncoding="utf-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>订单详情页</title>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/login2.css">
    <link href="${pageContext.request.contextPath}/css/bootstrap.min.css" rel="stylesheet">
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.min.js"></script>
    <script type="text/javascript">
        function pay(orderId, money) {
            location.href = "pay.jsp?oid=" + orderId + "&omoney=" + money;
        }

        function payWeiXin(orderId, money) {
            location.href = "payWeixin.jsp?oid=" + orderId + "&omoney=" + money;
        }
    </script>
    <style type="text/css">
        .table tr th{
            text-align: center;
        }
    </style>
</head>
<%@ include file="header.jsp" %>
<div class="panel panel-default" style="margin: 0 auto;width: 95%;">
    <div class="panel-heading">
        <h3 class="panel-title"><span class="glyphicon glyphicon-equalizer"></span>&nbsp;&nbsp;订单详情</h3>
    </div>
    <div class="panel-body">
        <table cellpadding="0" cellspacing="0" align="center" width="100%"
               class="table table-striped table-bordered table-hover">
            <tr>
                <th align="center">订单编号</th>
                <td>${map.order.id}</td>
                <th align="center">订单时间</th>
                <td>${map.order.time}</td>
            </tr>
            <tr>
                <th align="center">收件人</th>
                <td>${map.address.name}</td>
                <th align="center">联系电话</th>
                <td>${map.address.phone}</td>
            </tr>
            <tr>
                <th align="center">送货地址</th>
                <td>${map.address.detail}</td>
                <th align="center">总价</th>
                <td>${map.order.money}</td>
            </tr>
            <tr>
                <th align="center">商品列表</th>
                <td colspan="3">
                    <table align="center" cellpadding="0" cellspacing="0" width="100%"
                           class="table table-striped table-bordered table-hover">
                        <tr align="center" class="info">
                            <th>序号</th>
                            <th>商品封面</th>
                            <th>商品名称</th>
                            <th>商品评分</th>
                            <th>商品日期</th>
                            <th>商品单价</th>
                            <th>购买数量</th>
                            <th>小计</th>
                        </tr>
                        <c:forEach items="${map.list}" var="item" varStatus="i">
                            <tr align="center" style="height: 70px;line-height: 70px">
                                <th>${i.count}</th>
                                <th>
                                    <img src="${pageContext.request.contextPath}/goodsImgServlet?method=lodding&p=${item.goods.picture}"
                                         width="50px" height="50px" style="border-radius: 50%">
                                </th>
                                <th>${item.goods.name}</th>
                                <th>${item.goods.star}</th>
                                <th>${item.goods.pubdate}</th>
                                <th>${item.goods.price}</th>
                                <th>${item.num}</th>
                                <th>${item.money}</th>
                            </tr>
                        </c:forEach>
                    </table>
                </td>
            </tr>
            <tr>
                <td align="right" colspan="4" style="margin-right: 40px;">
                    <a href="${pageContext.request.contextPath}/orderservlet?method=getOrderList" class="btn btn-danger btn-sm">返回订单列表</a>
                    &nbsp;&nbsp;
                    <c:if test="${map.order.status eq 1 }">
                        <button type="button" onclick="pay('${map.order.id}','${map.order.money}')"
                                class="btn btn-warning btn-sm">易付宝支付
                        </button>
                        &nbsp;&nbsp;
                        <button type="button" onclick="payWeiXin('${map.order.id}','${map.order.money}')"
                                class="btn btn-success btn-sm">微信支付
                        </button>
                    </c:if>
                </td>
            </tr>
        </table>
    </div>
</div>
<%@ include file="footer.jsp" %>
</body>
</html>